export const jsonClone = (obj) => {
  if (!(obj instanceof Object)) return obj
  let res = Array.isArray(obj) ? [] : {}
  for (let key in obj) {
    if (obj[key] instanceof Object) {
      res[key] = jsonClone(obj[key])
    } else {
      res[key] = obj[key]
    }
  }
  return res
} 